/*
 * @Author: wangyongcun
 * @Date: 2023-02-21 19:53:05
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-06-08 18:38:56
 * @Description: 课程管理-接口定义和函数集合
 */
import { Request } from "@/utils/axios";

// ** 表头定义
export const tableColumn = [
    {
        prop: "userName",
        label: "用户名",
        minWidth: "180",
    },
    {
        prop: "nickName",
        label: "昵称",
        minWidth: "180",
    },
    {
        prop: "phoneNum",
        label: "手机号",
        minWidth: "180",
    },
    {
        prop: "accountType",
        label: "用户类型",
        minWidth: "180",
    }
];

/**
 * @description: 添加课程
 * @param {*} params
 * @return {*}
 */
export const addRequest = async (params) => {
    return Request.post("/teaching-organization/person/addPerson", params, {
        headers: {
            autoTip: "fail",
        },
    });
};

/**
 * @description: 更新用户信息
 * @param {*} params
 * @return {*}
 */
export const updateRequest = async (params) => {
    return Request.post("/teaching-organization/person/updatePerson", params, {
        headers: {
            autoTip: "fail",
        },
    });
};

/**
 * @description: 删除用户
 * @param {*} params
 * @return {*}
 */
export const deleteRequest = async (params) => {
    return Request.post("/teaching-organization/person/deletePerson", params, {
        headers: {
            autoTip: "fail",
        },
    });
};

/**
 * @description: 获取用户列表
 * @param {*} params
 * @return {*}
 */
export const queryListRequest = async (params) => {
    console.log(params, "paramsparams")
    return Request.get("/teaching-organization/user/queryUserList", { params: params }, {
        headers: {
            autoTip: "fail",
        },
    });
};

/**
 * @description: 获取用户列表
 * @param {*} params
 * @return {*}
 */
export const queryTeathListRequest = async (params) => {
    return Request.get("/teaching-organization/person/queryPersonByAccountType", { params: params }, {
        headers: {
            autoTip: "fail",
        },
    });
};

